package com.blacktry.config.schedule;

import com.blacktry.service.ExamManageService;
import com.blacktry.service.JobService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UpdateExamTimeSchedule implements Job {
    private static final Logger logger = LoggerFactory.getLogger(JobA.class);
    private JobService jobService;

    @Autowired
    private ExamManageService examManageService;

    @Override
    public void execute(JobExecutionContext context) {
        // 做考试时间检测的方法
        System.out.println("考试时间已自动更新");
        // 这里写需要执行的业务逻辑
        examManageService.updateExamStateByTime();
    }
}
